#!/bin/bash
var1=abcd-1234-defg
echo "var1=$var1"
t=${var1#*-*}
echo "var1 (with everything,up to and including first - striped out) = $t"
t=${var1##*-*}
echo "if var1 contains a \"-\",returns empty string...  val1=$t" 
t=${var1%*-*}
echo "var1 (with everything from the last - on stripped out)=$t"
